package com.csxy.jqr.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(name = "EduCourse对象",description = "课程")
public class EduCourse implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "课程ID")
    @TableId(value = "id", type = IdType.ASSIGN_UUID)
    private String id;

    @Schema(description = "课程讲师ID")
    private String teacherId;

    @Schema(description = "课程专业ID")
    private String subjectId;

    @Schema(description = "一级分类ID")
    private String subjectParentId;

    @Schema(description = "课程标题")
    private String title;

    @Schema(description = "课程销售价格，设置为0则可免费观看")
    private BigDecimal price;

    @Schema(description = "总课时")
    private Integer lessonNum;

    @Schema(description = "课程封面图片路径")
    private String cover;

    @Schema(description = "销售数量")
    private Long buyCount;

    @Schema(description = "浏览数量")
    private Long viewCount;

    @Schema(description = "乐观锁")
    @Version
    private Long version;

    @Schema(description = "课程状态 Draft未发布 Normal已发布")
    private String status;

    @Schema(description = "逻辑删除 1（true）已删除， 0（false）未删除")
    @TableLogic
    private Integer isDeleted=0;

    @Schema(description = "创建时间", example = "2019-01-01 8:00:00")
    @TableField(fill = FieldFill.INSERT)
    private Date gmtCreate;

    @Schema(description = "更新时间", example = "2019-01-01 8:00:00")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date gmtModified;
}
